package com.car.loan.project.xr.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.car.loan.project.xr.util.bo.business.modify.ModifyIgnore;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.TableName;


/**
 * 客户配偶对象 xr_customer_spouse
 *
 * @author ruoyi
 * @date 2019-11-03
 */
@TableName("xr_customer_spouse")
@Data
@Accessors(chain = true)
public class CustomerSpouse {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Long id;

    private Long customerId;

    @ModifyIgnore
    public Long getId() {
        return id;
    }

    @ModifyIgnore
    public Long getCustomerId() {
        return customerId;
    }

    @ApiModelProperty("姓名")
    private String name;

    @ApiModelProperty("手机号码")
    private String mobile;

    @ApiModelProperty("证件类型 0=身份证")
    private Integer idType;

    /**
     * 证件号码
     */
    @ApiModelProperty("证件号码")
    private String idCardNo;

    /**
     * 是否担保  0=不担保  5=公司担保  10=银行担保
     */
    @ApiModelProperty("担保方式0=不担保、5=公司担保、10=银行担保")
    private Integer guarantee;

    @ModifyIgnore
    public Integer getGuarantee() {
        return guarantee;
    }

    @TableField(exist = false)
    @ApiModelProperty("担保方式")
    @JsonIgnore
    private String guaranteeStr;

    public String getGuaranteeStr() {
        if (null != guarantee) {
            if (guarantee == 0) {
                return "不担保";
            } else if (guarantee == 5) {
                return "公司担保";
            } else if (guarantee == 10) {
                return "银行担保";
            }
        }
        return guaranteeStr;
    }

    /**
     * 工作单位
     */
    @ApiModelProperty("工作单位")
    private String workUnit;

    /**
     * 职务
     */
    @ApiModelProperty("职务")
    private String duty;

    /**
     * 单位电话
     */
    @ApiModelProperty("单位电话")
    private String unitTel;

    /**
     * 单位省
     */
    @ApiModelProperty("单位省")
    private String unitProvince;

    /**
     * 单位市
     */
    @ApiModelProperty("单位市")
    private String unitCity;

    /**
     * 单位区
     */
    @ApiModelProperty("单位区")
    private String unitArea;

    /**
     * 单位地址
     */
    @ApiModelProperty("单位地址")
    private String unitAddress;


}
